/**
 * Created by ljf on 2018/4/19.
 * 加载框
 */
import React, { Component } from "react";
import { ActivityIndicator, StyleSheet } from "react-native";
import { windowHeight, windowWidth } from "../../configs/platform";
import { inject, observer } from "mobx-react";
import { TouchableOpacity, View } from "react-native-ui-lib";

@inject('appStore')
@observer
export default class Loading extends Component {

  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    if (this.props.appStore.showLoading == false)
      return null;
    return (
      <TouchableOpacity activeOpacity={1}
                        onPress={()=>this.props.appStore.finishFetch()}
                        center style={StyleSheet.absoluteFill} pointerEvents={"box-none"}>
        <View style={styles.container}>
         <ActivityIndicator
                        size="large"
                        color="white"
                    />
        </View>
      </TouchableOpacity>
    );
  }
}


const styles = StyleSheet.create({
    modal: {
        width: windowWidth,
        height: windowHeight,
        backgroundColor: 'transparent',
        alignItems: 'center',
        justifyContent: 'center'
    },
    container: {
        width: 90,
        height: 90,
        alignItems: 'center',
        justifyContent: 'center',
        borderRadius:8,
        backgroundColor:'#00000080',
    },
});


